package com.czy.booktest02.demos.exception;


import com.czy.booktest02.demos.constant.ResultStatus;
import lombok.Data;

@Data
public class GlobalException extends RuntimeException {
    /**
     * 异常码
     */
    private Integer status;

    /**
     * 异常信息
     */
    private String msg;

    public GlobalException(ResultStatus resultStatus) {
        this.status = resultStatus.getCode();
        this.msg = resultStatus.getMsg();
    }

    public GlobalException(ResultStatus resultStatus, String msg) {
        this.status = resultStatus.getCode();
        this.msg = msg;
    }
}
